package com.macro.mall.service.impl;

import com.macro.mall.dao.GoodsManagementDao;
import com.macro.mall.dto.GoodsManagementDto;
import com.macro.mall.dto.GoodsTypeDao;
import com.macro.mall.service.GoodsManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class GoodsManagementServiceImpl implements GoodsManagementService {
    @Autowired
    private GoodsManagementDao goodsManagementDao;

    /**
     * 查询物品管理列表
     *
     * @return
     */
    @Override
    public List<GoodsManagementDto> getGoodsManagementList() {
        return goodsManagementDao.getGoodsManagementList();
    }

    /**
     * 新增物品管理
     *
     * @param goodsManagement
     * @return
     */
    @Override
    public int goodsManagementAdd(GoodsManagementDto goodsManagement) {
        int count = goodsManagementDao.goodsManagementAdd(goodsManagement);
        return count;
    }

    /**
     * 删除物品管理
     *
     * @param goodsManagement
     * @return
     */
    @Override
    public int goodsManagementUpdate(GoodsManagementDto goodsManagement) {
        int count = goodsManagementDao.goodsManagementUpdate(goodsManagement);
        return count;
    }

    /**
     * 查询物品管理对象
     *
     * @param id
     * @return
     */
    @Override
    public int goodsManagementDelete(Integer id) {
       int count = goodsManagementDao.goodsManagementDelete(id);
       return count;
    }

    /**
     * 查询物品管理对象
     *
     * @param id
     * @return
     */
    @Override
    public GoodsManagementDto goodsManagementSearch(Integer id) {
      GoodsManagementDto goodsManagement=  goodsManagementDao.goodsManagementSearch(id);
      return goodsManagement;
    }

    /**
     * 查询物品类型
     *
     * @return
     */
    @Override
    public List<GoodsTypeDao> getGoodsType() {
      List  <GoodsTypeDao> goodsTypeDao = goodsManagementDao.getGoodsType();
        return goodsTypeDao;
    }




}
